package org.example.infrastructure.repository.orm.database;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.model.entity.url.UrlShortenerNetworkStats;
import org.example.domain.model.entity.url.req.UrlShortenerGroupStatsReq;
import org.example.domain.model.entity.url.req.UrlShortenerStatsReq;
import org.example.domain.repository.UrlShortenerNetworkStatsRepository;
import org.example.infrastructure.persistence.orm.UrlShortenerNetworkStatsMapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
@RequiredArgsConstructor
public class MybatisUrlShortenerNetworkStatsRepository implements UrlShortenerNetworkStatsRepository {
    private final UrlShortenerNetworkStatsMapper urlShortenerNetworkStatsMapper;

    @Override
    public void insertUrlShortenerNetworkStats(UrlShortenerNetworkStats urlShortenerNetworkStats) {
        urlShortenerNetworkStatsMapper.insertUrlShortenerNetworkStats(urlShortenerNetworkStats);
    }

    @Override
    public List<UrlShortenerNetworkStats> networkStatsByUrlShortenerList(UrlShortenerStatsReq urlShortenerStatsReq) {
        return urlShortenerNetworkStatsMapper.networkStatsByUrlShortenerList(urlShortenerStatsReq);
    }

    @Override
    public List<UrlShortenerNetworkStats> networkStatsByGroupList(UrlShortenerGroupStatsReq urlShortenerGroupStatsReq) {
        return urlShortenerNetworkStatsMapper.networkStatsByGroupList(urlShortenerGroupStatsReq);
    }
}
